package edu.upf.da.p2p.sm.client.message;

import org.jivesoftware.smack.packet.Message;

import edu.upf.da.p2p.sm.P2PMessage;

public class AuthRequest extends P2PMessage {

	public AuthRequest(Message m){super(m);}

	public AuthRequest(String user, String pass) {
		super();
		setSubject("login");
		setProperty("user", user);
		setProperty("pass", pass);
	}
	public AuthRequest(){
		super();
		setSubject("logout");
	}

	public boolean isLogIn(){
		return getSubject().equals("login");
	}

	public boolean isLogOut(){
		return getSubject().equals("logout");
	}

	public String getUser(){
		return (String) getProperty("user");
	}

	public String getPass(){
		return (String) getProperty("pass");
	}

}
